/*
提交链接：https://leetcode.cn/problems/climbing-stairs/description/
70.爬楼梯
刘思琪 2024/9/8
*/

class Solution {
public:
   int way[46];
   int climbStairs(int n) {
       Way();
       return way[n];
    }
    void Way(){
        way[1]=1;
        way[2]=2;
        for(int i=3;i<=45;i++)
        way[i]=way[i-1]+way[i-2];
    }
};